package com.betterjr.modules.application;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

@Controller
@RequestMapping(value = "/Platform/test/api")
public class PlatformTestController {

    private static final Logger logger = LoggerFactory.getLogger(PlatformTestController.class);

    @RequestMapping("/trade/supplierTrade/detail/list")
    @ResponseBody
    public String testQuery(String idList) {

        JSONArray array = new JSONArray();
        JSONObject object = new JSONObject();
        object.put("id", "abcdef1");
        object.put("supplierName", "中山市华莱登卫浴有限公司");
        object.put("supplierCode", "zhongsan888");
        object.put("enterpriseName", "广东德豪润达电气股份有限公司");
        object.put("enterId", "102200336");
        object.put("fundId", "102202019");
        object.put("fundIName", "深圳前海特智商业保理有限公司");
        object.put("tradeMoney", 10009.00);
        object.put("tradeDate", "2018-06-27 11:12:05");
        array.add(object);
        return array.toJSONString();
    }

    @RequestMapping("/trade/supplierTrade/right")
    @ResponseBody
    public String testSave(String idList) {

        JSONObject object = new JSONObject();
        object.put("code", "200");
        object.put("msg", "success");
        object.put("data", "xxxxx");
        return object.toJSONString();
    }
}
